package com.slliver.productservice.service.impl;

import com.slliver.commonmodel.product.Product;
import com.slliver.productservice.service.ProductService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;


@Service
public class ProductServiceImpl implements ProductService {

    @Override
    public Product getProductById(Long productId) {
        Product product = new Product();
        product.setId(productId);
        product.setProductName("机器猫的盲盒");
        product.setPrice(new BigDecimal("40.5"));
        product.setNum(1);
        product.setDesc("机器猫的盲盒非常好玩，适合小朋友");

        // 模拟超时100秒
        /**
        try {
            TimeUnit.SECONDS.sleep(4);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        **/
        return product;
    }


}
